    <script>
        $(document).ready(function() {
            // Initialize navgoco with default options
            $("#mysidebar").navgoco({
                caretHtml: '',
                accordion: true,
                openClass: 'active', // open
                save: false, // leave false or nav highlighting doesn't work right
                cookie: {
                    name: 'navgoco',
                    expires: false,
                    path: '/'
                },
                slide: {
                    duration: 400,
                    easing: 'swing'
                }
            });

            $("#collapseAll").click(function(e) {
                e.preventDefault();
                $("#mysidebar").navgoco('toggle', false);
            });

            $("#expandAll").click(function(e) {
                e.preventDefault();
                $("#mysidebar").navgoco('toggle', true);
            });

        });

    </script>
    <script>
        $(function () {
            $('[data-toggle="tooltip"]').tooltip()
        })
    </script>
    <script>
        $(document).ready(function() {
            $("#tg-sb-link").click(function() {
                $("#tg-sb-sidebar").toggle();
                $("#tg-sb-content").toggleClass('col-md-9');
                $("#tg-sb-content").toggleClass('col-md-12');
                $("#tg-sb-icon").toggleClass('fa-toggle-on');
                $("#tg-sb-icon").toggleClass('fa-toggle-off');

if ($("#tg-sb-icon").hasClass('fa-toggle-on')) {
    createCookie("nonav", "false", 365);
} else {
    createCookie("nonav", "true", 365);
}

            });
            if (readCookie("nonav") == "true") {
                $("#tg-sb-link").click();
            };
            $("#tg-dark-link").click(function() {
if ($("#tg-dark-icon").hasClass('fa-toggle-on')) {
    $('link[href="/css/theme-dark.css"]').attr('href','/css/theme-light.css');
    createCookie("dark", "false", 365);
} else {
    $('link[href="/css/theme-light.css"]').attr('href','/css/theme-dark.css');
    createCookie("dark", "true", 365);
}
                $("#tg-dark-icon").toggleClass('fa-toggle-on');
                $("#tg-dark-icon").toggleClass('fa-toggle-off');
            });
            if (readCookie("dark") == "true") {
                $("#tg-dark-link").click();
            };
        });
    </script>
    {% if page.datatable == true %}
    <!-- Include the standard DataTables bits -->
    <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.13/css/jquery.dataTables.css">
    <script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.13/js/jquery.dataTables.js"></script>
    <!-- First, this walks through the tables that occur between ...-begin
         and ...-end and add the "datatable" class to them.
         Then it invokes DataTable's standard initializer
         Credit here: http://www.beardedhacker.com/blog/2015/08/28/add-class-attribute-to-markdown-table/
      -->
    <script>
      $(document).ready(function(){
          $('div.datatable-begin').nextUntil('div.datatable-end', 'table').addClass('display');
          $('table.display').DataTable( {
              paging: true,
              stateSave: true,
              searching: true
          });
       });
    </script>
    {% endif %}

